package builder;

import java.util.Vector;

import model.Action;

public class CommandBuilder extends AbstractPatternBuilder {

	private String client = "Client";
	private String receiver = "Receiver";
	private String invoker = "Invoker";
	private String command = "Command";
	private String concreteCommand = "ConcreteCommand";
	
	public CommandBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(client);
		this.buildClass(invoker);
		this.buildClass(concreteCommand);
		this.buildClass(receiver);
		
		this.buildAbstractClass(command);
		
		this.buildDependency(client, concreteCommand);
		
		this.buildGeneralization(concreteCommand, command);
		
		this.buildAssociation(client, receiver);
		this.buildAssociation(concreteCommand, receiver);
		
		this.buildAggregation(command, invoker);
		
		return patternActions;
	}

	@Override
	public void changeNames() {
		
		client = names.get(0);
		receiver = names.get(1);
		invoker = names.get(2);
		command = names.get(3);
		concreteCommand = names.get(4);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 5;
	}

}
